Skip to content

chore: derive build version from git tags for all components#305

Merged
johntmyers merged 1 commit intomainfrom
chore/git-derived-version
Mar 14, 2026
Merged

chore: derive build version from git tags for all components#305
johntmyers merged 1 commit intomainfrom
chore/git-derived-version

Conversation

@johntmyers
Copy link
Copy Markdown
Collaborator

Summary

All Rust binaries and the TUI splash screen now show the correct git-derived version (e.g. 0.0.4-dev.6+g2bf9969) instead of the hardcoded 0.1.0 from Cargo.toml.

Changes

  • Added git_version() to openshell-core/build.rs that computes version from git describe --tags using the guess-next-dev scheme (matching the existing setuptools-scm release pipeline)
  • Exported openshell_core::VERSION constant that all components use — falls back to CARGO_PKG_VERSION when .git is absent (Docker/CI builds)
  • Replaced all env!("CARGO_PKG_VERSION") references across CLI, server (gRPC health, HTTP readyz, auth page), sandbox, and TUI splash screen
  • Added OPENSHELL_CARGO_VERSION support to docker-build-cluster.sh, Dockerfile.cluster, and cluster-deploy-fast.sh for supervisor parity with gateway builds
  • Cleaned up TUI splash footer to put version and prompt on separate lines (the longer git-derived version string was crowding the single-line layout)

CI Impact

None. In Docker/CI builds where .git is excluded (via .dockerignore) and git is not installed, git_version() returns None and the fallback to CARGO_PKG_VERSION (sed-patched by the existing pipeline) is used. Behavior is identical to before.

Testing

  • mise run pre-commit passes
  • Verified openshell --versionopenshell 0.0.4-dev.6+g2bf9969
  • Verified openshell-server --versionopenshell-server 0.0.4-dev.6+g2bf9969
  • Verified openshell-sandbox --versionopenshell-sandbox 0.0.4-dev.6+g2bf9969
  • All unit tests pass

Checklist

  • Follows Conventional Commits
  • No secrets or credentials committed
  • Changes scoped to version derivation only

Compute version strings from git describe in openshell-core's build.rs
using the guess-next-dev scheme (e.g. 0.0.4-dev.6+g2bf9969). All binary
crates and the TUI splash screen now use the shared openshell_core::VERSION
constant instead of CARGO_PKG_VERSION.

In Docker/CI builds where .git is absent, falls back to CARGO_PKG_VERSION
which is already set correctly by the sed-patch pipeline. Also adds
OPENSHELL_CARGO_VERSION support to the cluster image and fast-deploy
supervisor builds for parity with the gateway.
@johntmyers johntmyers self-assigned this Mar 14, 2026
@johntmyers johntmyers requested a review from drew March 14, 2026 21:21
@johntmyers johntmyers merged commit eed9002 into main Mar 14, 2026
9 checks passed
@johntmyers johntmyers deleted the chore/git-derived-version branch March 14, 2026 21:58
drew pushed a commit that referenced this pull request Mar 16, 2026
Compute version strings from git describe in openshell-core's build.rs
using the guess-next-dev scheme (e.g. 0.0.4-dev.6+g2bf9969). All binary
crates and the TUI splash screen now use the shared openshell_core::VERSION
constant instead of CARGO_PKG_VERSION.

In Docker/CI builds where .git is absent, falls back to CARGO_PKG_VERSION
which is already set correctly by the sed-patch pipeline. Also adds
OPENSHELL_CARGO_VERSION support to the cluster image and fast-deploy
supervisor builds for parity with the gateway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants